<template>
  <ga-form ref="formRef" :model="formData">
    <ga-form-item
      field="url"
      label="地址"
      label-col-flex="90px"
      :rules="[RULE.NOT_NULL]"
      :validate-trigger="['change', 'input']"
    >
      <ga-input v-model="formData.url" placeholder="请输入内容" />
    </ga-form-item>
    <!-- <ga-form-item
      field="token"
      label="Token"
      tooltip="当前用户登录态，bk_token与bk_username必须一个有效，bk_token可以通过Cookie获取"
      label-col-flex="90px"
      :rules="[RULE.NOT_NULL]"
      :validate-trigger="['change', 'input']"
    >
      <ga-input v-model="formData.token" placeholder="请输入内容" />
    </ga-form-item> -->
    <ga-form-item
      field="username"
      label="用户名"
      tooltip="当前用户用户名，应用免登录态验证白名单中的应用，用此字段指定当前用户"
      label-col-flex="90px"
      :rules="[RULE.NOT_NULL]"
      :validate-trigger="['change', 'input']"
    >
      <ga-input v-model="formData.username" placeholder="请输入内容" />
    </ga-form-item>
    <ga-form-item
      field="appCode"
      label="应用ID"
      label-col-flex="90px"
      :rules="[RULE.NOT_NULL]"
      :validate-trigger="['change', 'input']"
    >
      <ga-input v-model="formData.appCode" placeholder="请输入内容" />
    </ga-form-item>
    <ga-form-item
      field="appSecret"
      label="安全密钥"
      tooltip="安全密钥(应用 TOKEN)，可以通过 蓝鲸智云开发者中心 -> 点击应用ID -> 基本信息 获取"
      label-col-flex="90px"
      :rules="[RULE.NOT_NULL]"
      :validate-trigger="['change', 'input']"
    >
      <ga-input v-model="formData.appSecret" placeholder="请输入内容" />
    </ga-form-item>
    <ga-form-item
      field="waitTime"
      label="初始化时间"
      label-col-flex="90px"
      :rules="[RULE.NOT_NULL]"
      :validate-trigger="['change', 'input']"
    >
      <ga-input v-model="formData.waitTime" placeholder="请输入内容" />
    </ga-form-item>
  </ga-form>
</template>
<script setup>
import { ref, reactive } from "vue";
import { RULE } from "@/constant/validators";
const formData = defineModel();
const formRef = ref(null);
// const formData = reactive({
//   url: "",
//   token: "",
//   username: "",
//   appCode: "",
//   appSecret: "",
//   waitTime: "",
// });
defineExpose({
  formRef,
  formData,
});
</script>
